

OUTPUT TO c:\adjcst.txt .


DEFINE BUFFER tr FOR tr_hist .
    
FOR EACH tr_hist WHERE tr_hist.tr_type = "cst-adj" AND tr_hist.tr_effdate = DATE(3,7,2006) 
    AND (tr_hist.tr_mtl_std + tr_hist.tr_lbr_std + tr_hist.tr_sub_std + tr_hist.tr_ovh_std + tr_hist.tr_bdn_std) <> tr_hist.tr_price 
    BREAK BY tr_hist.tr_part BY tr_hist.tr_site WITH FRAME a STREAM-IO WIDTH 240 DOWN:
/*
    DISP  tr_hist.tr_part tr_hist.tr_site tr_hist.tr_effdate tr_hist.tr_price tr_hist.tr_mtl_std tr_hist.tr_sub_std 
        tr_hist.tr_program.
    DOWN 1 WITH FRAME a .
*/
    FOR EACH tr WHERE tr.tr_part = tr_hist.tr_part AND tr.tr_site = tr_hist.tr_site AND tr.tr_type = "cst-adj" 
        AND tr.tr_effdate < DATE(3,7,2006) :
/*
        DISP 
            tr.tr_effdate  @ tr_hist.tr_effdate 
            tr.tr_price @ tr_hist.tr_price
            tr.tr_mtl_std @ tr_hist.tr_mtl_std
            tr.tr_sub_std @ tr_hist.tr_sub_std 
            tr.tr_program @ tr_hist.tr_program
            WITH FRAME a.

        DOWN 1 WITH FRAME a .
*/
        DELETE tr .
    END.

    ASSIGN
        tr_hist.tr_price = tr_hist.tr_mtl_std + tr_hist.tr_sub_std .

END.
